import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import NotFound from '@/components/not-found/index.vue' // 页面引入方法一
import Home from '@/views/Home.vue'

const routes: Array<RouteRecordRaw> = [
  // 访问不到页面时
  { path: '/:pathMatch(.*)*', name: 'NotFound', component: NotFound },
  {
    path: '/home',
    name: 'Home',
    component: Home
  },
  {
    path: '/',
    // path: '/knowledgePoints',
    name: 'knowledgePoints',
    component: () => import('@/views/knowledgePoints/index.vue')
  },
  {
    path: '/tsType',
    name: 'tsType',
    component: () => import('@/views/knowledgePoints/components/tsType/index.vue')
  },
  {
    path: '/tsTypeSuper',
    name: 'tsTypeSuper',
    component: () => import('@/views/knowledgePoints/components/tsTypeSuper/index.vue')
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
